//============================================================================================
/**
 * @file	g3d_anime_manager.h
 * @brief   3Dアニメーション関連処理
 * @author	nozomu saito
 * @date	2007.05.18
 */
//============================================================================================
#ifndef __G3D_ANIME_MANAGER_H__
#define __G3D_ANIME_MANAGER_H__

#define LOOP_INFINIT		(-1)

typedef struct G3D_ANIME_MANAGER_LIST_tag*	G3D_ANM_MNG_LST_PTR;
typedef struct G3D_ANIME_MANAGER_tag*	G3D_ANM_MNG_PTR;
typedef struct G3D_ANIME_DATA_tag*		G3D_ANM_DATA_PTR;

typedef void* G3D_ANM_CUSTOM_WORK_PTR;
typedef void (*CSTM_SETUP_FUNC)(	NNSFndAllocator *Allocator,
									NNSG3dAnmObj** pAnmObj,
									void *mem,
									G3D_ANM_CUSTOM_WORK_PTR pCustomWork );

extern G3D_ANM_MNG_LST_PTR G3dAnime_InitManagerList( const int inHeapID );

extern G3D_ANM_MNG_PTR G3dAnime_CreateManager( G3D_ANM_MNG_LST_PTR pMngLstPtr, const int inHeapID, const int inAnimeNum );

extern void G3dAnime_End( G3D_ANM_MNG_LST_PTR pMngLstPtr );

extern G3D_ANM_DATA_PTR G3dAnime_PopAnmData( G3D_ANM_MNG_PTR pMngPtr );

extern void G3dAnime_PushAnmData(G3D_ANM_MNG_PTR pMngPtr, G3D_ANM_DATA_PTR pAnmData);

extern const u16 G3dAnime_GetAnmStackNum(G3D_ANM_MNG_PTR pMngPtr);

extern void G3dAnime_Main(G3D_ANM_MNG_LST_PTR pMngLstPtr);
extern void G3dAnime_StopAllAnm( G3D_ANM_MNG_LST_PTR pMngLstPtr );
extern void G3dAnime_SetStartFrameAll( G3D_ANM_MNG_LST_PTR pMngLstPtr );

extern void G3dAnime_SetupAnimeDefault(	G3D_ANM_MNG_PTR pMngPtr,
										G3D_ANM_DATA_PTR pAnmData,
										void*	mem,
										NNSG3dResMdl*	pModel,
										NNSG3dResTex*	pTex);


extern void G3dAnimeData_SetAnmResMem(G3D_ANM_DATA_PTR pAnmData, void *mem);

extern void G3dAnimeData_Entry(	G3D_ANM_DATA_PTR pAnmData,
								const int inLoop,
								const BOOL inStop,
								const BOOL inReverse );

extern void G3dAnimeData_SetStartFrame(G3D_ANM_DATA_PTR pAnmData);

extern void G3dAnimeData_FreeAnimeObj(G3D_ANM_MNG_PTR pMngPtr, G3D_ANM_DATA_PTR pAnmData);

extern void G3dAnimeData_Add(NNSG3dRenderObj *pRenderObj, G3D_ANM_DATA_PTR pAnmData);

extern BOOL G3dAnimeData_Remove(NNSG3dRenderObj *pRenderObj, G3D_ANM_DATA_PTR pAnmData);

extern void G3dAnime_CustomSetup(	G3D_ANM_MNG_PTR pMngPtr,
									G3D_ANM_DATA_PTR pAnmData,
									void* mem,
									G3D_ANM_CUSTOM_WORK_PTR pWork	);
extern void G3dAnime_SetCustomFunc(G3D_ANM_MNG_PTR pMngPtr, CSTM_SETUP_FUNC pFunc);

extern u16 G3dAnimeData_GetLoopMax(G3D_ANM_DATA_PTR pAnmData);
extern void G3dAnimeData_SetStopFlg(G3D_ANM_DATA_PTR pAnmData, const BOOL inFlg);
extern void G3dAnimeData_MoveAnime(G3D_ANM_DATA_PTR pAnmData);
extern BOOL G3dAnimeData_IsAnimeEnd(G3D_ANM_DATA_PTR pAnmData);
extern void G3dAnimeData_SetLastFrame(G3D_ANM_DATA_PTR pAnmData);
extern void G3dAnimeData_SetAnimeReverse(G3D_ANM_DATA_PTR pAnmData);
extern void G3dAnimeData_SetAnimeReverseDirect(G3D_ANM_DATA_PTR pAnmData, const BOOL inReverse);
extern void G3dAnimeData_SetAnimeLoopMax(G3D_ANM_DATA_PTR pAnmData, const int inLoopMax);

#endif	//__G3D_ANIME_MANAGER_H__

